﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Mime;
using UnityEngine;
using UnityEngine.UI;

public class Hint : MonoBehaviour
{
    public static Hint Instance;

    private void Awake()
    {
        Instance = this;
    }

    public GameObject m_hint;

    public void CloseHint()
    {
        //恢复血量
        BooldControl.Instance.Health = 100;
        BooldControl.Instance.Mood = 100;
        //骰子数量归零
        CardsControl.Instance.OwnDiceCount = 0;

        Destroy(m_hint);
    }

    public void ShowHint(string content)
    {
        GameObject obj = LoadPrefab.Instance.LoadPrefab2Scenes<GameObject>("UI/Hint", true, "Canvas/Panel");
        obj.GetComponent<Hint>().m_hint = obj;
        obj.transform.Find("Text").GetComponent<Text>().text = content;

        RectTransform rect = obj.GetComponent<RectTransform>();
        rect.offsetMax = Vector2.zero;
        rect.offsetMin = Vector2.zero;
    }
    
    
    
    
}